v5

latestSwagger 2.0MIT2026-08-03485217850.7 KB
repository

The extended "contents" API, to get file metadata and/or content, or list a directory.

It guarantees that only one of the response fields is set if the request succeeds. Users can pass "includes=file_content" or "includes=lfs_metadata" to retrieve more fields. "includes=file_content" only works for single file, if you need to retrieve file contents in batch, use "file-contents" API after listing the directory.

get/repos/{owner}/{repo}/contents-ext/{filepath}

Path parameters

ownerstring required

owner of the repo

repostring required

name of the repo

filepathstring required

path of the dir, file, symlink or submodule in the repo. Swagger requires path parameter to be "required", you can leave it empty or pass a single dot (".") to get the root directory.

Query parameters

refstring

the name of the commit/branch/tag, default to the repository’s default branch.

includesstring

By default this API's response only contains file's metadata. Use comma-separated "includes" options to retrieve more fields. Option "file_content" will try to retrieve the file content, "lfs_metadata" will try to retrieve LFS metadata, "commit_metadata" will try to retrieve commit metadata, and "commit_message" will try to retrieve commit message.

Response